package com.tencent.examples.blueking.mysql.repository;

import com.tencent.examples.blueking.mysql.model.BkMessage;
import com.tencent.examples.blueking.mysql.model.BkSaveNavigationBar;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface BkSaveNavigationBarRepository extends JpaRepository<BkSaveNavigationBar, Long>, JpaSpecificationExecutor<BkSaveNavigationBar> {

    @Transactional(timeout = 10)
    @Query("select m from BkMessage m where m.mx = ?1")
    BkMessage findByMx(String mx);

}
